package org.brain.pojos;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Documenttype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "DOCUMENTTYPE", schema = "PUBLIC", catalog = "PUBLIC")
public class Documenttype implements java.io.Serializable {

	// Fields

	private Integer typeid;
	private String typename;
	private Set<Document> documents = new HashSet<Document>(0);

	// Constructors

	/** default constructor */
	public Documenttype() {
	}

	/** full constructor */
	public Documenttype(String typename, Set<Document> documents) {
		this.typename = typename;
		this.documents = documents;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "TYPEID", unique = true, nullable = false)
	public Integer getTypeid() {
		return this.typeid;
	}

	public void setTypeid(Integer typeid) {
		this.typeid = typeid;
	}

	@Column(name = "TYPENAME", length = 20)
	public String getTypename() {
		return this.typename;
	}

	public void setTypename(String typename) {
		this.typename = typename;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "documenttype")
	public Set<Document> getDocuments() {
		return this.documents;
	}

	public void setDocuments(Set<Document> documents) {
		this.documents = documents;
	}

}